export const MimeTypeUtil = {
  IMAGE_PNG: 'image/png',

  IMAGE_JPG: 'image/jpg',

  IMAGE_JPEG: 'image/jpeg',

  IMAGE_BMP: 'image/bmp',

  IMAGE_GIF: 'image/gif',

  IMAGE_EXTENSION: ['bmp', 'gif', 'jpg', 'jpeg', 'png'],

  FLASH_EXTENSION: ['swf', 'flv'],

  MEDIA_EXTENSION: ['swf', 'flv', 'mp3', 'wav', 'wma', 'wmv', 'mid', 'avi', 'mpg',
    'asf', 'rm', 'rmvb'],

  VIDEO_EXTENSION: ['mp4', 'avi', 'rmvb'],

  DEFAULT_ALLOWED_EXTENSION: [
    // 图片
    'bmp', 'gif', 'jpg', 'jpeg', 'png', 'svg',
    // word excel powerpoint
    'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'html', 'htm', 'txt',
    // 压缩文件
    'rar', 'zip', 'gz', 'bz2',
    // 视频格式
    'mp4', 'avi', 'rmvb',
    // pdf
    'pdf',
    // 模型
    'rvt', 'dgn', 'ifc', 'dwg',
    // mac 隐藏文件
    'DS_Store'
  ],

  getExtension (prefix) {
    switch (prefix) {
      case this.IMAGE_PNG:
        return 'png'
      case this.IMAGE_JPG:
        return 'jpg'
      case this.IMAGE_JPEG:
        return 'jpeg'
      case this.IMAGE_BMP:
        return 'bmp'
      case this.IMAGE_GIF:
        return 'gif'
      default:
        return ''
    }
  }

}
